package com.gwcd.myapplication.tools.aos;

import android.content.Context;
import android.net.wifi.WifiManager;

import com.gwcd.myapplication.MyApplication;
import com.gwcd.myapplication.tools.base.StringUtil;

/**
 * @author LiuBo
 * @date 2021-12-15
 */
public class NetworkUtil {
    public static Context sContext = null;

    public static String getSsid() {
        WifiManager wifiManager = (WifiManager) sContext.getSystemService(Context.WIFI_SERVICE);
        String ts = wifiManager.getConnectionInfo().getSSID();
        if (StringUtil.isNotEmpty(ts) && ts.startsWith("\"") && ts.endsWith("\"")) {
            return ts.substring(1, ts.length() - 1);
        }
        return ts;
    }
}
